package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.util.List;

/**
 * 用户表 实体bean
 */
@TableName("t_user")
public class UserBean {
    /** 用户id */
    @TableId(value = "pk_userId",type = IdType.AUTO)
    private Integer id;
    /** 用户名 */
    @TableField("u_userName")
    private String userName;
    /** 用户密码 */
    @TableField("u_pwd")
    private String pwd="123456";
    /** 用户真实名 */
    @TableField("u_name")
    private String name;
    @TableField("u_salt")
    private String salt;
    /** 用户拥有的角色集合 */
    @TableField(exist = false)
    private List<RoleBean> roleBeanList;
    /** 用户拥有的权限集合 */
    @TableField(exist = false)
    private List<GradeBean> gradeBeanList;

    public UserBean() {
    }

    public UserBean(String userName, String name) {
        this.userName = userName;
        this.name = name;
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<RoleBean> getRoleBeanList() {
        return roleBeanList;
    }

    public void setRoleBeanList(List<RoleBean> roleBeanList) {
        this.roleBeanList = roleBeanList;
    }

    public List<GradeBean> getGradeBeanList() {
        return gradeBeanList;
    }

    public void setGradeBeanList(List<GradeBean> gradeBeanList) {
        this.gradeBeanList = gradeBeanList;
    }

    @Override
    public String toString() {
        return "UserBean{" +
                "id=" + id +
                ", userName='" + userName + '\'' +
                ", pwd='" + pwd + '\'' +
                ", name='" + name + '\'' +
                ", salt='" + salt + '\'' +
                ", roleBeanList=" + roleBeanList +
                ", gradeBeanList=" + gradeBeanList +
                '}';
    }
}
